<?php
require_once('../includes/init.php');

if ((int)$_SESSION[SESSION_PREFIX]['user_id'] > 0) {
    $sql = "update `cart` set session_id='".$_SESSION[SESSION_PREFIX]['session_id']."' WHERE `user_id`='".$_SESSION[SESSION_PREFIX]['user_id']."' and session_id != '".$_SESSION[SESSION_PREFIX]['session_id']."'";
    $zz = $db->getRow($sql);
    
    $sql = "update `cart` set user_id='".$_SESSION[SESSION_PREFIX]['user_id']."' WHERE session_id = '".$_SESSION[SESSION_PREFIX]['session_id']."' and user_id=0 ";
    $zz = $db->getRow($sql);
}

?>
<html lang="zh-CN">
    <head>
        <title>五联五金</title>
        <meta charset="utf-8">
        <title><?php echo $title;?>-<?php echo $cfg_site['web_title'];?></title>
        <meta charset="utf-8">
        <meta id="keywords" name="keywords" content="<?php echo $keyword;?>" />
        <meta id="description" name="description" content="<?php echo $description;?>" />
        <!-- bootstrap -->
        <link rel="stylesheet" href="../css/new/bootstrap.min.css">
        <script src="../js/jquery-1.7.1.min.js"></script>
        
        <script type="text/javascript">
            document.write("<link rel='stylesheet' href='../css/new/index.css?random="+Math.random()+"'>")
        </script>

        <link rel="stylesheet" href="../css/new/swiper-3.4.2.min.css" >
        <script src="../js/new/swiper.min.js"></script>
        <style>
            .login_alert_block{
                display: none;
            }
        </style>
    </head>
    <body style="">
        <div class="wrap" id="app">
            <!-- 头部 -->
            <!-- 顶部导航栏 -->
            <div class="wj_sitenav" style="background: #f5f5f5;position: sticky;top: 0;z-index: 8888;">
                <div style="width: 1200px;margin: auto;display: flex;">
                    <div class="sitenav_flet">
                        <span  style="padding-left: 3px;" >您好！欢迎光临 &nbsp;</span><a href="/new/index.php" style="color: #444141;" class="go_home">义文官方商城！</a>
                    </div>
                    <div class="sitenav_right">
                        <?php if($_SESSION[SESSION_PREFIX]['user_id']=='' || $_SESSION[SESSION_PREFIX]['user_id']=='0'):?>
                            <!-- 未登录状态 -->
                            <ul class="t_ul" id="no_logon">
                                <li class="sitenav_right_user_li">
                                    <div class="not_logon showLoginBtn">
                                        <a>您好请登录</a>
                                    </div>
                                </li>
                                <li class=""><span>|</span><a href="/member/register.php">免费注册</a><span>|</span></li>
                                <li>
                                <a>客户服务<span>|</span></a>
                                <div class="kef_fuwu_content nav_tanceng box">
                                    <div class="top_pp box">
                                        <h1 class="box">客户服务</h1>
                                        <div class="detail box">
                                            <div class="item"><a href="<?php echo $domain; ?>/newmember/help.php">帮助中心</a></div>
                                            <div class="item"><a href="https://p.qiao.baidu.com/cps4/chatIndex?siteToken=fa9edd6c146a2526c2a20e5302b32e57&speedLogId=160263314181962f2_1602633141819_29294&reqParam=%7B%22from%22%3A0,%22sessionid%22%3A%22%22,%22siteId%22%3A%221050923%22,%22tid%22%3A%22-1%22,%22userId%22%3A%223244648%22,%22ttype%22%3A1,%22siteConfig%22%3A%7B%22eid%22%3A%223244648%22,%22queuing%22%3A%22%22,%22siteToken%22%3A%22fa9edd6c146a2526c2a20e5302b32e57%22,%22userId%22%3A%223244648%22,%22isGray%22%3A%22false%22,%22wsUrl%22%3A%22wss%3A%2F%2Fp.qiao.baidu.com%2Fcps4%2Fwebsocket%22,%22likeVersion%22%3A%22generic%22,%22siteId%22%3A%221050923%22,%22online%22%3A%22true%22,%22webRoot%22%3A%22%2F%2Fp.qiao.baidu.com%2Fcps4%2F%22,%22bid%22%3A%22158519076548463203%22,%22isSmallFlow%22%3A0,%22isPreonline%22%3A0,%22invited%22%3A0%7D,%22config%22%3A%7B%22themeColor%22%3A%224d74fa%22%7D%7D">在线客服</a></div>
                                            <!-- <div class="item"><a>电话客服（）</a></div>
                                            <div class="item"><a>邮箱客服（）</a></div> -->
                                        </div>
                                    </div>
                                    
                                </div>
                            </li>
                            <li>
                                <a>网站导航<span>|</span></a>
                                <div class="com_daohang_content nav_tanceng box">
                                     <ul class="com_daohang_content_ul">
                                        <li>
                                            <div class="tit">童装母婴</div>
                                            <div class="item_ls">
                                                <div class="item">服装内衣</div>
                                                <div class="item">鞋包配饰</div>
                                                <div class="item">运动户外</div>
                                                <div class="item">日用百货</div>
                                                <div class="item">汽车用品</div>
                                                <div class="item">工艺品及宠物食品</div>
                                                <div class="item">家纺家饰</div>
                                                <div class="item">家装建材</div>
                                                <div class="item">美妆日化</div>
                                                <div class="item">数码家电</div>
                                                <div class="item">电工电气</div>
                                                <div class="item">安全防护照明</div>
                                                <div class="item">电子机械</div>
                                                <div class="item">汽摩五金工具</div>
                                                <div class="item">仪器仪表</div>
                                                <div class="item">化工原料</div>
                                                <div class="item">精细化学</div>
                                                <div class="item">冶金矿产钢材</div>
                                                <div class="item">橡塑包装纺织皮革</div>
                                            </div>
                                        </li>
                                        <li>
                                            <div class="tit">童装母婴</div>
                                            <div class="item_ls">
                                                <div class="item">服装内衣</div>
                                                <div class="item">鞋包配饰</div>
                                                <div class="item">运动户外</div>
                                                <div class="item">日用百货</div>
                                                <div class="item">汽车用品</div>
                                                <div class="item">工艺品及宠物食品</div>
                                                <div class="item">家纺家饰</div>
                                                <div class="item">家装建材</div>
                                                <div class="item">美妆日化</div>
                                                <div class="item">数码家电</div>
                                                <div class="item">电工电气</div>
                                                <div class="item">安全防护照明</div>
                                                <div class="item">电子机械</div>
                                                <div class="item">汽摩五金工具</div>
                                                <div class="item">仪器仪表</div>
                                                <div class="item">化工原料</div>
                                                <div class="item">精细化学</div>
                                                <div class="item">冶金矿产钢材</div>
                                                <div class="item">橡塑包装纺织皮革</div>
                                            </div>
                                        </li>
                                        <li>
                                            <div class="tit">特色市场</div>
                                            <div class="item_ls">
                                                 
                                                <div class="item">电子机械</div>
                                                <div class="item">汽摩五金工具</div>
                                                <div class="item">仪器仪表</div>
                                                <div class="item">化工原料</div>
                                                <div class="item">精细化学</div>
                                                <div class="item">冶金矿产钢材</div>
                                                <div class="item">橡塑包装纺织皮革</div>
                                            </div>
                                        </li>
                                        <li>
                                            <div class="tit">以商会友</div>
                                            <div class="item_ls">
                                                <div class="item">精细化学</div>
                                                <div class="item">冶金矿产钢材</div>
                                                <div class="item">橡塑包装纺织皮革</div>
                                            </div>
                                        </li>
                                        <li>
                                            <div class="tit">常用工具</div>
                                            <div class="item_ls">
                                                <div class="item">精细化学</div>
                                                <div class="item">冶金矿产钢材</div>
                                                <div class="item">橡塑包装纺织皮革</div>
                                            </div>
                                        </li>
                                        <li>
                                            <div class="tit">安全交流</div>
                                            <div class="item_ls">
                                                <div class="item">精细化学</div>
                                                <div class="item">冶金矿产钢材</div>
                                                <div class="item">橡塑包装纺织皮革</div>
                                            </div>
                                        </li>
                                     </ul>
                                    
                                </div>
                            
                            </li>
                            <li>
                                <a>联系我们<span>|</span></a>
                                <div class="tel_me_content nav_tanceng box">
                                    <div class="top_pp box">
                                        <h1 class="box">联系我们</h1>
                                        <div class="tel_me_code_a_way box">
                                            <div class="detail fl box">
                                                <p>热线：<a class="e9">4008-717-355</a></p>
                                                <p>邮箱：<a href="mailto:info@evan.com.cn">info@evan.com.cn</a></p>
                                                <p>地址：上海市浦东新区航都路8号13幢</p>
                                            </div>
                                            <div class="fr_img"><img src="../img/code.png" alt="二维码"></div>
                                        
                                        </div>
                                    </div>
                                    
                                </div>
                            </li>
                                <li class="box" style="color: #E90211; padding-left: 20px;   background: url(../img/ico_top_tel.png) no-repeat 4px 9px; background-size:9px 10px; ">4008-717-355</li>
                            </ul>
                        <?php else:?>
                            <!-- 已登录 -->
                            <ul class="t_ul" id="logining">
                                <li class="sitenav_right_user_li">
                                    <div class="logining">
                                        <a href="/newmember" target="_black">尊敬的：<span style="color:#E90211"><?php echo $_SESSION[SESSION_PREFIX]['username'];?></span></a>
                                        <a href="/newmember" target="_black">
                                        <div class="user_info_block nav_tanceng">
                                            <div class="user_info_detail box">
                                                <?php 
                                                $sqlUser="select * from user where user_id = " . $_SESSION[SESSION_PREFIX]['user_id'];
                                                $userRow = $db->getRow($sqlUser);
                                                if($userRow['pics'] == ""){
                                                    $userPic = "https://www.pentalink.com/newmember/images/none.png";

                                                }else{
                                                    $userPic = "https://www.pentalink.com/upload" .$userRow['pics'];
                                                }
                                                ?>
                                                <div class="user_avtimg"><img style="height: 100%;" src="<?php echo $userPic; ?>" alt="头像"></div>
                                                <div class="user_menu">
                                                    <h3><?php echo $_SESSION[SESSION_PREFIX]['username'];?> </h3>
                                                    <p>用户类型：个人</p>
                                                    <p>用户等级：普通用户</p>
                                                </div> 
                                            </div>
                                        </a>
                                            <div class="user_info_quanxian box">
                                                <a href="/newmember" target="_black">我的特权</a>
                                                <a href="./login.php?act=logout">退出登录</a>
                                            </div>
                                        </div>
                                    </div>
                                </li>
                                <li class="my_order">
                                    <span>|</span><a href="/newmember/booking.php" target="_black">我的订单</a><span>|</span>
                                    <div class="my_order_content nav_tanceng box">
                                        <div class="top_pp box">
                                            <h1 class="box">我的订单</h1>
                                            <div class="detail box">
                                                <?php
                                                    $userId = $_SESSION[SESSION_PREFIX]['user_id'];
                                                    $waitSure = $db->getAll("select * from order_info where order_status = 0 and pay_status = 1 and user_id = $userId");
                                                    $waitPay = $db->getAll("select * from order_info where order_status = 0 and pay_status = 0 and user_id = $userId");
                                                    $waitGet = $db->getAll("select * from order_info where order_status in (2, 3, 4) and user_id = $userId");
                                                    $finishOrder = $db->getAll("select * from order_info where order_status = 99 and user_id = $userId");
                                                ?>
                                                <div class="item"><a href="<?php echo $domain; ?>/newmember/booking.php?times=&types=1">待确认<span><?php echo count($waitSure); ?>单</span></a></div>
                                                <div class="item"><a href="<?php echo $domain; ?>/newmember/booking.php?times=&types=2">待支付<span><?php echo count($waitPay); ?>单</span></a></div>
                                                <div class="item"><a href="<?php echo $domain; ?>/newmember/booking.php?times=&types=4">待收货<span><?php echo count($waitGet); ?>单</span></a></div>
                                                <div class="item"><a href="<?php echo $domain; ?>/newmember/booking.php?times=&types=5">已完成<span><?php echo count($finishOrder); ?>单</span></a></div>
                                            </div>
                                        </div>
                                        
                                        <div class="commit_qx">
                                            <a href="<?php echo $domain; ?>/newmember/booking.php">全部订单</a>
                                            <a href="<?php echo $domain; ?>/newmember/booking.php?times=&types=6">已取消</a>
                                        </div>
                                    </div>
                                </li>
                                <li>
                                    <a>我的义文</a><span>|</span>
                                    <div class="my_yiwen_content nav_tanceng box">
                                        <div class="top_pp box">
                                            <h1 class="box">我的义文</h1>
                                            <div class="detail box">
                                                <div class="item"><a href="<?php echo $domain; ?>/newmember/fapiao.php">我的发票</a></div>
                                                <div class="item"><a href="<?php echo $domain; ?>/newmember/pingjia.php">我的评价</a></div>
                                                <div class="item"><a href="<?php echo $domain; ?>/newmember/shouhuo.php">我的售后</a></div>
                                                <div class="item"><a href="<?php echo $domain; ?>/newmember/shoucang.php">我的收藏</a></div>
                                                <div class="item"><a href="<?php echo $domain; ?>/newmember/3ddownload.php">我的下载</a></div>
                                                <div class="item"><a href="<?php echo $domain; ?>/newmember/liulan.php">我的浏览</a></div>
                                            </div>
                                        </div>
                                        
                                    </div>
                                
                                </li>
                                <li>
                                <a>客户服务<span>|</span></a>
                                <div class="kef_fuwu_content nav_tanceng box">
                                    <div class="top_pp box">
                                        <h1 class="box">客户服务</h1>
                                        <div class="detail box">
                                            <div class="item"><a target="_blank" href="<?php echo $domain; ?>/newmember/help.php">帮助中心</a></div>
                                            <div class="item"><a target="_blank" href="https://p.qiao.baidu.com/cps4/chatIndex?siteToken=fa9edd6c146a2526c2a20e5302b32e57&speedLogId=160263314181962f2_1602633141819_29294&reqParam=%7B%22from%22%3A0,%22sessionid%22%3A%22%22,%22siteId%22%3A%221050923%22,%22tid%22%3A%22-1%22,%22userId%22%3A%223244648%22,%22ttype%22%3A1,%22siteConfig%22%3A%7B%22eid%22%3A%223244648%22,%22queuing%22%3A%22%22,%22siteToken%22%3A%22fa9edd6c146a2526c2a20e5302b32e57%22,%22userId%22%3A%223244648%22,%22isGray%22%3A%22false%22,%22wsUrl%22%3A%22wss%3A%2F%2Fp.qiao.baidu.com%2Fcps4%2Fwebsocket%22,%22likeVersion%22%3A%22generic%22,%22siteId%22%3A%221050923%22,%22online%22%3A%22true%22,%22webRoot%22%3A%22%2F%2Fp.qiao.baidu.com%2Fcps4%2F%22,%22bid%22%3A%22158519076548463203%22,%22isSmallFlow%22%3A0,%22isPreonline%22%3A0,%22invited%22%3A0%7D,%22config%22%3A%7B%22themeColor%22%3A%224d74fa%22%7D%7D">在线客服</a></div>
                                            <!-- <div class="item"><a>电话客服（）</a></div>
                                            <div class="item"><a>邮箱客服（）</a></div> -->
                                        </div>
                                    </div>
                                    
                                </div>
                            </li>
                            <li>
                                <a>网站导航<span>|</span></a>
                                <div class="com_daohang_content nav_tanceng box">
                                     <ul class="com_daohang_content_ul">
                                        <li>
                                            <div class="tit">童装母婴</div>
                                            <div class="item_ls">
                                                <div class="item">服装内衣</div>
                                                <div class="item">鞋包配饰</div>
                                                <div class="item">运动户外</div>
                                                <div class="item">日用百货</div>
                                                <div class="item">汽车用品</div>
                                                <div class="item">工艺品及宠物食品</div>
                                                <div class="item">家纺家饰</div>
                                                <div class="item">家装建材</div>
                                                <div class="item">美妆日化</div>
                                                <div class="item">数码家电</div>
                                                <div class="item">电工电气</div>
                                                <div class="item">安全防护照明</div>
                                                <div class="item">电子机械</div>
                                                <div class="item">汽摩五金工具</div>
                                                <div class="item">仪器仪表</div>
                                                <div class="item">化工原料</div>
                                                <div class="item">精细化学</div>
                                                <div class="item">冶金矿产钢材</div>
                                                <div class="item">橡塑包装纺织皮革</div>
                                            </div>
                                        </li>
                                        <li>
                                            <div class="tit">童装母婴</div>
                                            <div class="item_ls">
                                                <div class="item">服装内衣</div>
                                                <div class="item">鞋包配饰</div>
                                                <div class="item">运动户外</div>
                                                <div class="item">日用百货</div>
                                                <div class="item">汽车用品</div>
                                                <div class="item">工艺品及宠物食品</div>
                                                <div class="item">家纺家饰</div>
                                                <div class="item">家装建材</div>
                                                <div class="item">美妆日化</div>
                                                <div class="item">数码家电</div>
                                                <div class="item">电工电气</div>
                                                <div class="item">安全防护照明</div>
                                                <div class="item">电子机械</div>
                                                <div class="item">汽摩五金工具</div>
                                                <div class="item">仪器仪表</div>
                                                <div class="item">化工原料</div>
                                                <div class="item">精细化学</div>
                                                <div class="item">冶金矿产钢材</div>
                                                <div class="item">橡塑包装纺织皮革</div>
                                            </div>
                                        </li>
                                        <li>
                                            <div class="tit">特色市场</div>
                                            <div class="item_ls">
                                                 
                                                <div class="item">电子机械</div>
                                                <div class="item">汽摩五金工具</div>
                                                <div class="item">仪器仪表</div>
                                                <div class="item">化工原料</div>
                                                <div class="item">精细化学</div>
                                                <div class="item">冶金矿产钢材</div>
                                                <div class="item">橡塑包装纺织皮革</div>
                                            </div>
                                        </li>
                                        <li>
                                            <div class="tit">以商会友</div>
                                            <div class="item_ls">
                                                <div class="item">精细化学</div>
                                                <div class="item">冶金矿产钢材</div>
                                                <div class="item">橡塑包装纺织皮革</div>
                                            </div>
                                        </li>
                                        <li>
                                            <div class="tit">常用工具</div>
                                            <div class="item_ls">
                                                <div class="item">精细化学</div>
                                                <div class="item">冶金矿产钢材</div>
                                                <div class="item">橡塑包装纺织皮革</div>
                                            </div>
                                        </li>
                                        <li>
                                            <div class="tit">安全交流</div>
                                            <div class="item_ls">
                                                <div class="item">精细化学</div>
                                                <div class="item">冶金矿产钢材</div>
                                                <div class="item">橡塑包装纺织皮革</div>
                                            </div>
                                        </li>
                                     </ul>
                                    
                                </div>
                            </li>
                            <li>
                                <a>联系我们<span>|</span></a>
                                <div class="tel_me_content nav_tanceng box">
                                    <div class="top_pp box">
                                        <h1 class="box">联系我们</h1>
                                        <div class="tel_me_code_a_way box">
                                            <div class="detail fl box">
                                                <p>热线：<a class="e9">4008-717-355</a></p>
                                                <p>邮箱：<a href="mailto:info@evan.com.cn">info@evan.com.cn</a></p>
                                                <p>地址：上海市浦东新区航都路8号13幢</p>
                                            </div>
                                            <div class="fr_img"><img src="../img/code.png" alt="二维码"></div>
                                        
                                        </div>
                                    </div>
                                    
                                </div>
                            </li>
                                <li class="box" style="color: #E90211; padding-left: 20px;   background: url(../img/ico_top_tel.png) no-repeat 4px 9px; background-size:9px 10px; ">4008-717-355</li>
                            </ul>
                        <?php endif;?>
                    </div>
                </div>
            </div>

            <!-- 弹框登录 -->
            <div class="login_alert_block">
                <div class="login_alert_content_close"><img src="../img/ico_close.png" alt="关闭"></div>
                <div class="login_alert_content transform">
                    <div class="tit">账号登录</div>
                     
                    <div class="login_area">
                        <div id="err_msg"></div>
                        <ul>
                            <li><input type="tel" placeholder="请输入邮箱或用户名" class="user_info box user_name" ></li>
                            <li><input type="password" placeholder="请输入密码" class="user_info box user_pwd" name="pwd" datatype="passwordtype"></li>
                            <li><input type="text" placeholder="请输入验证码"
                                       class="user_info user_yzm box user_code" 
                                       name="code" />
                                       <img id="captcha" style="border: 1px solid #dadada; cursor:pointer;height: 48px;" src="../includes/securimage/securimage_show.php?sid=<?php echo md5(uniqid()) ?>" onclick="this.src='../includes/securimage/securimage_show.php?sid='+Math.random()" alt="看不清？换一个" title="看不清？换一个" height="30" align="left" />
                                       <img class="fr shuaxin" src="../img/ico_login_shuaxin.png" style="cursor: pointer;" onclick="refleshCode()" alt="刷新">
                            </li>
                            <li><a href="javascript:;" class="btn btn_red" id="signin_btn" class="box">登录</a></li>
                        </ul>
                        <div class="signin_fooer_info">
                            <a class="fl" href="/member/findpwd.php">忘记密码</a>
                            <a class="fr" href="/member/register.php">立即注册</a>
                        </div>
                    </div>
                </div>
            </div>